package domain.entities;

import javax.persistence.*;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Reaprobaciones entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "reaprobaciones", catalog = "bms")
public class Reaprobaciones implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private Date externalEc;
	private Date localEc;
	private Date teachingCommittee;
    private Integer scope;

    public static final String CLASSTITLE = "Re-Approvals";
    public static final LinkedHashMap<String, String> TITULOS = new LinkedHashMap<String, String>(
            Collections.unmodifiableMap(
                    new LinkedHashMap<String, String>() {
                        {
                            put("externalEc", "External EC");
                            put("localEc", "Local EC");
                            put("teachingCommittee", "Teaching Committee");
                        }
                    }
            )
    );


    // Constructors

	/** default constructor */
	public Reaprobaciones() {
	}

	/** minimal constructor */
	public Reaprobaciones(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	/** full constructor */
	public Reaprobaciones(ProtocoloCentro protocoloCentro, Date externalEc,
			Date localEc, Date teachingCommittee) {
		this.protocoloCentro = protocoloCentro;
		this.externalEc = externalEc;
		this.localEc = localEc;
		this.teachingCommittee = teachingCommittee;
	}

    public Reaprobaciones(Reaprobaciones reaprobaciones) {
        this.protocoloCentro = reaprobaciones.getProtocoloCentro();
        this.externalEc = reaprobaciones.getExternalEc();
        this.localEc = reaprobaciones.getLocalEc();
        this.teachingCommittee = reaprobaciones.getTeachingCommittee();
    }

    // Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "centralEC", length = 10)
	public Date getExternalEc() {
		return this.externalEc;
	}

	public void setExternalEc(Date externalEc) {
		this.externalEc = externalEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "localEC", length = 10)
	public Date getLocalEc() {
		return this.localEc;
	}

	public void setLocalEc(Date localEc) {
		this.localEc = localEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "teachingCommittee", length = 10)
	public Date getTeachingCommittee() {
		return this.teachingCommittee;
	}

	public void setTeachingCommittee(Date teachingCommittee) {
		this.teachingCommittee = teachingCommittee;
	}

    @Column(name = "scope")
    public Integer getScope() {
        return scope;
    }

    public void setScope(Integer scope) {
        this.scope = scope;
    }
}